**************************************************************************************
* 1 JULY 2021                                       
*                                                      
* Replication File for "A DELICATE BALANCING ACT: WOMEN'S RIGHTS AND US MILITARY   
* INTERVENTION IN THE ARAB WORLD" 
*
* Journal of Middle East Women's Studies. 2021. Vol 17, no. 3.     
*                                                      
* by Amaney Jamal (ajamal@princeton.edu)               
* & Irfan Nooruddin (in62@georgetown.edu)              
*                                                      
*************************************************************************************


********************************************************************************************************************************

*** FIGURE 1. JORDAN AND WOMEN'S POLITICAL RIGHTS

*use "\jamal&nooruddin2021 - replication data for all tables, figures 1, 4, 5.dta"
twoway line wopol_re year if country=="Jordan"&year>=1980&year<=2010, sort /*
*/ ytitle("Women's Political Rights in Jordan") xtitle("Year") /*
*/ lcolor(black) lwidth(thick) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) /*
*/ plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))



** FIGURE 3: REGIONAL TROOP DEPLOYMENTS AND ANTI_GOVERNMENT DEMONSTRATIONS

*use "jamal&nooruddin2021 - replication data for figures 3 and A1.dta"
twoway (line ln_menatroop year if year>=1980, sort ytitle("US Troops in MENA Region (logged)") lcolor(black) lpattern(dash) lwidth(thick)) /*
*/ (line domestic8 year if year>=1980, lcolor(black) lpattern(solid) lwidth(thick) yaxis(2) ytitle("Anti-Government Demonstrations", axis(2))), /*
*/ leg(col(1)) leg(label(1 "US Troops in MENA region, logged")) leg(label(2 "Anti-Government Demonstrations")) leg(region(ls(none)))/*
*/ graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) 



** TABLE 1: REGRESSION RESULTS: TROOPS HURT WOMEN'S POLITICAL RIGHTS

set more off
*use "\jamal&nooruddin2021 - replication data for all tables, figures 1, 4, 5.dta"
xtset ccode year

* COLUMN 1
xi: xtreg wopol_re  c.ln_menatroop c.islamist  ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if arab==1&ctrycode!="SYR", cluster(ccode)

* COLUMN 2
xi: xtreg wopol_re  c.ln_menatroop##c.islamist  ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if arab==1&ctrycode!="SYR", cluster(ccode)

* TABLE NOTE
tab country if arab==1
tab country if e(sample)



** FIGURE 4: EFFECT OF ISLAMISM ON WOMEN'S POLITICAL RIGHTS AT DIFFERENT LEVELS OF US TROOP DEPLOYMENTS

set more off
*use "\jamal&nooruddin2021 - replication data for all tables, figures 1, 4, 5.dta"
quietly xi: xtreg wopol_re  c.ln_menatroop##c.islamist  ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if arab==1&ctrycode!="SYR", cluster(ccode)
margins, dydx(ln_menatroop) at((mean) _all islamist=(0 1 2) /*
*/year=2005 )
quietly margins, dydx(islamist) at((mean) _all ln_menatroop=(6(1)14) /*
*/year=2005 )
marginsplot, title(" ") ytitle("Marginal effect of Islamist Strength") /*
*/ xtitle("US Troop Deployments to MENA Region (logged)") yline(0, lcolor(gs10)) ciopts(msymbol(i) lcolor(black) lwidth(medthick)  lpattern(longdash)) /*
*/ plotopts(msymbol(i) lcolor(black) lwidth(medthick) ) /*
*/ addplot(histogram ln_menatroop  if e(sample),  /*
*/ fcolor(none) lcolor(gs10) lwidth(medthick) lpattern(solid) percent start(6) width(1) yscale(alt) /*
*/ yaxis(2)   /*
*/ xtitle("US Troop Deployments to MENA Region (logged)") xlabel(6 "403" 7 "1100" 8 "3000" 9 "8100" 10 "22k" 11 "60k" 12 "162k" 13 "442k" 14 "1.2m") /*
*/ ) recastci(rline) legend(off) /*
*/ graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))

marginsplot, title(" ") ytitle("Effect of Islamism on Women's Political Rights") /*
*/ xtitle("US Troop Deployments to MENA Region (logged)") /*
*/ xlabel(6 "403" 7 "1100" 8 "3000" 9 "8100" 10 "22k" 11 "60k" 12 "162k" 13 "442k" 14 "1.2m") /*
*/ yline(0, lcolor(gs10)) ciopts(msymbol(i) lcolor(black) lwidth(medthick)  lpattern(longdash)) /*
*/ plotopts(msymbol(i) lcolor(black) lwidth(medthick) ) /*
*/ recastci(rline) legend(off) /*
*/ graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) /*
*/ )



*** TABLE 2: ALTERNATIVE PATHWAYS/MECHANISMS

*use "\jamal&nooruddin2021 - replication data for all tables, figures 1, 4, 5.dta"
pwcorr ln_menatroop ln_wdi_gdppc_k wdi_gdppcgrowth wdi_open aid_pc wdi_oilrent prio_count if arab==1, sig


*** FIGURE 5. EGYPT AND WOMEN'S POLITICAL RIGHTS (SEE FOOTNOTE 1)

*use "\jamal&nooruddin2021 - replication data for all tables, figures 1, 4, 5.dta"
twoway line wopol_re year if country=="Egypt"&year>=1980&year<=2010, sort /*
*/ ytitle("Women's Political Rights in Egypt") xtitle("Year") /*
*/ lcolor(black) lwidth(thick) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) /*
*/ plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))



********************************************************************************************************************************

********************************************************************************************************************************


***************************
**** ONLINE APPENDIX
***************************


*** APPENDIX FIGURE A1. US TROOP DEPLOYMENTS IN THE MIDDLE EAST

*use "jamal&nooruddin2021 - replication data for figures 3 and A1.dta"
scatter ln_menatroop year if year>=1945&year<=2015, c(l) ytitle("US Troops in MENA Region (logged)") sort s(i) lcolor(black) lpattern(solid) lwidth(thick) /*
*/ graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) /*
*/ xlabel(1950(10)2010)


** APPENDIX TABLE A3: ORDERED PROBIT RESULTS: TROOPS HURT WOMEN'S POLITICAL RIGHTS 

*use "\jamal&nooruddin2021 - replication data for all tables, figures 1, 4, 5.dta"
* ORDERED PROBIT 
xi: xtoprobit wopol_re  ln_menatroop islamist ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if arab==1&ctrycode!="SYR", vce(cluster ccode)

xi: xtoprobit wopol_re  ln_menatroop islamist ln_menatroopXislamist ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if arab==1&ctrycode!="SYR", vce(cluster ccode)
tab country if e(sample)


** APPENDIX TABLE A4: USING PHYSICAL INTEGRITY AS THE DV
*use "\jamal&nooruddin2021 - replication data for all tables, figures 1, 4, 5.dta"
xi: xtreg physint  ln_menatroop islamist ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if e(sample), vce(cluster ccode)
xi: xtreg physint  ln_menatroop islamist ln_menatroopXislamist ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if e(sample), vce(cluster ccode)



** APPENDIX TABLE A5: USING EXPERT SURVEY CODING OF ISLAMIST POWER (EXPERTISLAM = STRENGTH_MEAN * THREAT_MEAN) 
*use "\jamal&nooruddin2021 - replication data for all tables, figures 1, 4, 5.dta"

*  OLS (column 1)
set more off
xi: xtreg wopol_re  c.ln_menatroop##c.expertislam  ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if arab==1, cluster(ccode)
quietly margins, dydx(expertislam) at((mean) _all ln_menatroop=(6(1)14) /*
*/year=2005 )
marginsplot, title(" ") ytitle("Marginal effect of Islamist Strength") /*
*/ xtitle("US Troop Deployments to MENA Region (logged)") yline(0, lcolor(gs10)) ciopts(msymbol(i) lcolor(black) lwidth(medthick)  lpattern(longdash)) /*
*/ plotopts(msymbol(i) lcolor(black) lwidth(medthick) ) /*
*/ addplot(histogram ln_menatroop  if e(sample),  /*
*/ fcolor(none) lcolor(gs10) lwidth(medthick) lpattern(solid) percent start(6) width(1) yscale(alt) /*
*/ yaxis(2)   /*
*/ xtitle("US Troop Deployments to MENA Region (logged)") xlabel(6 "403" 7 "1100" 8 "3000" 9 "8100" 10 "22k" 11 "60k" 12 "162k" 13 "442k" 14 "1.2m") /*
*/ ) recastci(rline) legend(off) /*
*/ graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))

set more off
xi: xtreg wopol_re  c.ln_menatroop##c.threat_mean  ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if arab==1, cluster(ccode)
quietly margins, dydx(threat_mean) at((mean) _all ln_menatroop=(6(1)14) /*
*/year=2005 )
marginsplot, title(" ") ytitle("Marginal effect of Islamist Strength") /*
*/ xtitle("US Troop Deployments to MENA Region (logged)") yline(0, lcolor(gs10)) ciopts(msymbol(i) lcolor(black) lwidth(medthick)  lpattern(longdash)) /*
*/ plotopts(msymbol(i) lcolor(black) lwidth(medthick) ) /*
*/ addplot(histogram ln_menatroop  if e(sample),  /*
*/ fcolor(none) lcolor(gs10) lwidth(medthick) lpattern(solid) percent start(6) width(1) yscale(alt) /*
*/ yaxis(2)   /*
*/ xtitle("US Troop Deployments to MENA Region (logged)") xlabel(6 "403" 7 "1100" 8 "3000" 9 "8100" 10 "22k" 11 "60k" 12 "162k" 13 "442k" 14 "1.2m") /*
*/ ) recastci(rline) legend(off) /*
*/ graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))


xi: xtreg wopol_re  c.ln_menatroop##c.strength_mean  ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if arab==1, cluster(ccode)
quietly margins, dydx(strength_mean) at((mean) _all ln_menatroop=(6(1)14) /*
*/year=2005 )
marginsplot, title(" ") ytitle("Marginal effect of Islamist Strength") /*
*/ xtitle("US Troop Deployments to MENA Region (logged)") yline(0, lcolor(gs10)) ciopts(msymbol(i) lcolor(black) lwidth(medthick)  lpattern(longdash)) /*
*/ plotopts(msymbol(i) lcolor(black) lwidth(medthick) ) /*
*/ addplot(histogram ln_menatroop  if e(sample),  /*
*/ fcolor(none) lcolor(gs10) lwidth(medthick) lpattern(solid) percent start(6) width(1) yscale(alt) /*
*/ yaxis(2)   /*
*/ xtitle("US Troop Deployments to MENA Region (logged)") xlabel(6 "403" 7 "1100" 8 "3000" 9 "8100" 10 "22k" 11 "60k" 12 "162k" 13 "442k" 14 "1.2m") /*
*/ ) recastci(rline) legend(off) /*
*/ graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) plotregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))


*  Ordered Probit (column 2)
xi: xtoprobit wopol_re  ln_menatroop expertislam ln_menatroopXexpertislam ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year if arab==1, vce(cluster ccode)



** APPENDIX TABLE A6: IV ANALYSIS
set more off
*use "\jamal&nooruddin2021 - replication data for all tables, figures 1, 4, 5.dta"
tsset ccode year
ivreg2 wopol_re islamist ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year  /*
*/ (ln_menatroop ln_menatroopXislamist = l.ushispturnout l.ushispturnoutXislamist) if arab==1&ctrycode~="SYR", cluster(ccode) first liml
lincom _b[islamist]+6*_b[ln_menatroopXislamist]
lincom _b[islamist]+7*_b[ln_menatroopXislamist]
lincom _b[islamist]+8*_b[ln_menatroopXislamist]
lincom _b[islamist]+9*_b[ln_menatroopXislamist]
lincom _b[islamist]+10*_b[ln_menatroopXislamist]
lincom _b[islamist]+11*_b[ln_menatroopXislamist]
lincom _b[islamist]+12*_b[ln_menatroopXislamist]

*  IV ANALYSIS USING ALTERNATIVE MEASURE OF ISLAMIST POWER
set more off
tsset ccode year
ivreg2 wopol_re expertislam ln_wdi_gdppc_k wdi_gdppcgrowth /*
*/ wdi_urbpop polity2_new wdi_open wdi_oilrent aid_pc1000 year  /*
*/ (ln_menatroop ln_menatroopXexpertislam = l.ushispturnout l.ushispturnoutXexpertislam) if arab==1, cluster(ccode) first liml
lincom _b[expertislam]+6*_b[ln_menatroopXexpertislam]
lincom _b[expertislam]+7*_b[ln_menatroopXexpertislam]
lincom _b[expertislam]+8*_b[ln_menatroopXexpertislam]
lincom _b[expertislam]+9*_b[ln_menatroopXexpertislam]
lincom _b[expertislam]+10*_b[ln_menatroopXexpertislam]
lincom _b[expertislam]+11*_b[ln_menatroopXexpertislam]
lincom _b[expertislam]+12*_b[ln_menatroopXexpertislam]

